<script setup lang="ts">
import { ref, reactive } from 'vue'
import { getList } from '@/api/index'

const stateInfo = reactive({
  list: [] as any[],
})
async function handleClick() {
  const { data } = await getList()
  stateInfo.list = data
}
</script>

<template>
  <main>
    Home
    <button @click="handleClick">get message</button>
    <div>
      <ul>
        <li v-for="item in stateInfo.list" :key="item.name">{{ item.name }}</li>
      </ul>
    </div>
  </main>
</template>
